{include file="top.html"}
<link rel="stylesheet" href="{$CSS_PATH}detail.css"/>
<script type="text/javascript" src="{$JS_PATH}jquery.cookie.js"></script>

<div class="wrapper clearfix">
    <div class="container">
        <div class="detail">
            <div class="detail-left">
                {if $goods['original_img'] eq ''}
                <img src="/images/{$grade}.png" alt="" title=""/>
                {else}
                <img src="{$goods.original_img}" alt="" title=""/>
                {/if}
            </div>
            <div class="detail-right">
                <h1 class="pro-title ">{$goods.goods_name}</h1>

                <div class="clearfix ">
                    <span class="feture-item" data-summary="学习规划一目了然，学习、练习、测试高度结合、完整的教学过程带来更好的学习效果！" data-feature="null"
                          original-title="">系统化学习</span>
                    <span class="feture-item" data-summary="课后作业专人批改，学习效果全掌握！" data-feature="null" original-title="">作业批改</span>
                    <span class="feture-item" data-summary="课后作业专人批改，学习效果全掌握！" data-feature="null" original-title="">  在线一对一  </span>
                    <span class="feture-item" data-summary="提供独家学习资料或内部讲义下载，辅助课程学习，达成最终学习目标！" data-feature="null"
                          original-title="">名师答疑</span>

                </div>
                <div class="clearfix detail-price">
                    <p>
                        <input id="shop-price" type="hidden" value="{$goods.shop_price}"/>
                        <span class="class-price-unit">￥</span><span class="class-price" id="sum-price">{$goods.shop_price}</span>
                        <!--<span class="class-price-unit">~ ￥</span> <span class="class-price" >{$goods.market_price}</span>-->
                        促销活动简短说明
                    </p>
                </div>

                <script type="text/javascript" src="//cdn.bootcss.com/jquery.tipsy/1.0.2/jquery.tipsy.js"></script>

                <script type="text/javascript">
                    $( ".feture-item" ).tipsy( {
                        gravity : 's',
                        fade    : true,
                        title   : function() {
                            return this.getAttribute( 'data-summary' );
                        },
                        opacity : 1,
                        delayIn : 0,
                        delayOut: 0
                    } );
                </script>
                <div class="clearfix detail-panel" id="attrs">
                    {foreach from=$specification item=spec key=spec_key}

                    <dl>
                        <dt class="_attr-key" data-tips="{$spec.tips}" data-keshi="{$spec.keshi}" data-level="{$spec.level}" data-attr-id="{$spec_key}">{$spec.name}：</dt>
                        {foreach from=$spec.values item=value key=key}
                        <dd class="_property {if $value.curr eq 1}active{/if}">
                            <a class="_attr-val" data-goods-id="{if $value.goods_id neq ''}{$value.goods_id}{else}{/if}" data-value-id="{$value.id}" data-url="{$value.link}{$value.vip_tag}"
                               data-price="{if $value.price neq ''}{$value.price}{else}{/if}">{$value.label}</a>
                        </dd>
                        {/foreach}
                    </dl>
                    {/foreach}
                   
                </div>
                 <!-- 选择课程错误提示 -->
                <div id="no-course-error-tips" class="error-tit" style="display: none;">
                    请选择课程
                </div>
                <div class="btns-box clearfix">
                    <a href="javascript:void(0);" class="btnBuy2 htevent" target="_blank" id="makeOrder">立即购买</a>
                    <a target="_blank" href="http://www10.53kf.com/webCompany.php?arg=10069074&style=1&keyword=&kf="
                       class="btnConsult htevent">课程咨询</a>
                </div>
                
            </div>
        </div>
        <div class="good-detail clearfix">
            <!-- <p>
            </p>
             <p>
                <img src="/images/pc/detail_05.jpg" alt="" title="">
            </p>
             <p>
                <img src="/images/pc/detail_06.jpg" alt="" title="">
            </p>
             <p>
                <img src="/images/pc/detail_07.jpg" alt="" title="">
            </p>
             <p>
                <img src="/images/pc/detail_08.jpg" alt="" title="">
            </p>
            </p> -->

            


        </div>
     
    </div>

    <script>
        $( function() {

            var attr_url = '';
            var goods_id='{$goods.goods_id}';
                //var goods_attr_id=$( '#attrs .active' ).last().find('a' ).attr('data-value-id');
            var item_tag=[];
            var item_attr={};

            $("._attr-val" ).each(function(){
                if($(this).parents('dd' ).hasClass('active'))
                {
                    var attr_key=$(this ).parents('dd' ).siblings('dt' ).text();
                    var attr_value=$(this ).text();
                    item_attr[attr_key]=attr_value;

                }
            })
            $( "._property" ).click( function() {
                attr_url = $( this ).find( 'a' ).attr( 'data-url' );
                window.location.href='?'+attr_url;
            } )
            function getAttrId()
            {
                var tt='';
                $("._attr-key" ).each(function(){
                    if($(this ).attr('data-keshi')!='')
                    {
                        tt=$(this).siblings('.active' ).find('a' ).attr('data-value-id');
                    }
                })

                return tt;
            }

            $( "#makeOrder" ).click( function() {
                var is_no_course='{$is_no_course}';

                if(is_no_course)
                {
                    return $("#no-course-error-tips" ).stop().fadeIn( 100 ).delay( 1000 ).fadeOut( 400 );
                }
                $.post( 'user.php?act=add_order', { goods_id: goods_id,goods_attr:item_attr }, function( data ) {
                    console.info( data );
                    //return ;
                    if( data.status == 'false' && data.type == 'no_login' ) {
                        return login();
                    }
                    window.location.href = 'user.php?act=confirm_order&goods_id=' + goods_id+'&goods_attr_id='+getAttrId();
                }, 'json' );
            } )
        })
    </script>

 <!--<iframe src="/getHfjy.php" width="100%" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" height="100%" id="iframepage" name="iframepage" onLoad="iFrameHeight()" >
</iframe>-->
</div>
<script type="text/javascript" language="javascript">

    function iFrameHeight() {

        var ifm= document.getElementById("iframepage");

        var subWeb = document.frames ? document.frames["iframepage"].document :

ifm.contentDocument;

            if(ifm != null && subWeb != null) {

            ifm.height = subWeb.body.scrollHeight+30;

            }

    }

</script> 

</body>
</html>